// 
// File:   ServerStat.h
// Author: dnazarov
//
// Created on 5 Октябрь 2009 г., 13:00
//

#ifndef _SERVERSTAT_H
#define	_SERVERSTAT_H

#include "sockets/SocketHandler.h"
#include "sockets/ListenSocket.h"
#include "sockets/TcpSocket.h"
#include "agentsocket.h"
#include <string>
#include "serversocket.h"
#include <vector>
#include <map>
#include "cfgparser.h"

class Data;

using namespace std;

struct pool
{
   const  vector<string> * host;
   const  vector<string> * ip;
   vector<bool> state;
};




class ServerStat
{
public:
    
    ServerStat();
    ~ServerStat();
    void listen();
    
    virtual void reply(const std :: string &) {};
    bool request(const std::string &, const string &, int);

protected:
    
    map<string,string> * m_hosts;
    pool m_pool;
    uint m_countOfElements;
    const std::string * m_bot_host;
    void setReplyHandler(ServerStat * rh){if(rh) m_replyHandler = rh;}
  
private:
            
    ServerStat * m_replyHandler;
    Data * m_data;
    CfgParser * m_config;
    
};

#endif	/* _ServerStat_H */
